<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center">
                <div class="table-first-id">ID</div>
            </th>
            <th class="text-center" width="20%">班级名称</th>
            <th class="text-center" width="16%">专业/科目</th>
            <th class="text-center" width="15%">课程</th>
            <th class="text-center" width="15%">班主任</th>
            <th class="text-center" width="5%">学员数</th>
            <th class="text-center" width="7%">满班</th>
            <th class="text-center" width="6%">状态</th>
            <th class="text-center" width="11%">操作</th>
        </tr>
        </thead>
    </table>

    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody id="tbodyMaterial">
            <tr class="jqgfirstrow" role="row">
                <td class="text-center">
                    <div class="table-first-id"></div>
                </td>
                <td class="text-center" width="20%">&nbsp;</td>
                <td class="text-center" width="16%">&nbsp;</td>
                <td class="text-center" width="15%">&nbsp;</td>
                <td class="text-center" width="15%">&nbsp;</td>
                <td class="text-center" width="5%">&nbsp;</td>
                <td class="text-center" width="7%">&nbsp;</td>
                <td class="text-center" width="6%">&nbsp;</td>
                <td class="text-center" width="11%">&nbsp;</td>
            </tr>
            <tr th:if="${#maps.isEmpty(dataMap)} or ${#lists.isEmpty(dataMap['list'])}">
                <td colspan="10" class="text-center">
                <div class="noDataTipsBox">
                    <p><span class="c-4e fs16">还没有班级~~~</span></p>
                </div>
                </td>
            </tr>

            <tr th:each="classes : ${dataMap['list']}" th:attr="data-id=${classes['id']}">
                <td class="text-center">
                    <input type="checkbox" class="i-checks" name="id" th:value="${classes['id']}">
                </td>
                <td>
                    <img th:src="${#strings.isEmpty(classes['imageMap']['pcUrlMap']['small'])}?@{{path}/front/web/v3/img/default/default-class.jpg(path = ${staticPath})}:${classes['imageMap']['pcUrlMap']['small']}" width="30" height="30" style="max-width:100px" class="img-circle" th:text="'&nbsp'+${classes['name']}"/>
                </td>
                <td class="text-center">
                    <th:block th:if="!${#lists.isEmpty(classes['subjectList'])}">
                    <span class="pie" th:each="subject,subIndex : ${classes['subjectList']}">
                        <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                        <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                            <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                            <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                        </th:block>
                        <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                        <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
	                </span>
                    </th:block>
                    <th:block th:if="${#lists.isEmpty(classes['subjectList'])}">
                        <span class="pie">—</span>
                    </th:block>
                </td>
                <td class="text-center">
                    <span th:if="${classes['classesType']} == 1 and ${classes['course']}==null" th:text="'—'"></span>
                    <span th:if="${classes['classesType']} == 1 and ${classes['course']}!=null" th:text="${classes['course']['courseName']}"></span>
                    <span th:if="${classes['classesType']} != 1">—</span>
                </td>
                <td class="text-center" th:attrprepend="id='classes-member'+${classes['id']}" data-member>
                    <span th:if="${#lists.isEmpty(classes['memberList'])}" data-empty>—</span>
                    <span th:if="not ${#lists.isEmpty(classes['memberList'])}" th:each="member : ${classes['memberList']}" th:text="${#strings.concat(member['member']['teacherName'], '&nbsp;&nbsp;')}"></span>
                </td>
                <td class="text-center" th:text="${classes['studentCount']}"></td>
                <td class="text-center" data-full>
                    <span th:if="${classes['full']} == 1" class="label label-info">是</span>
                    <span th:if="${classes['full']} == 2" class="label label-default">否</span>
                </td>
                <td class="text-center" data-status>
                    <span th:if="${classes['status']} == 1" class="label label-info">正常</span>
                    <span th:if="${classes['status']} == 2" class="label label-danger">停班</span>
                </td>
                <td class="text-center">
                    <a th:href="@{/admin/classes/initUpdate?id={id}&step=2(id=${classes['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="查看"><i class="fa fa-eye"></i></a>
                    <a href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="班主任"><i class="fa fa-male"></i></a>
                    <a th:href="@{/admin/classes/initUpdate?id={id}&step=2(id=${classes['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="学员"><i class="fa fa-user-plus"></i></a>
                    <a th:if="${classes['status'] == 1}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="停班"><i class="fa fa-unlock-alt"></i></a>
                    <a th:if="${classes['status'] == 2}" href="javascript:void(0)" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复"><i class="fa fa-history"></i></a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>

</html>
